<?php

/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/display/genericdisplay.class.php
-----------------------------------------------------
 Purpose: This file builds all visual aspects of the site.
 All browser output is managed by this file.
=====================================================
*/

class Genericdisplay
{
	function html_header($stylesheet){
	
		$title = '';
		
	 		if ($title == '') {
	 		
            	$title = $this->title;
            	
            }
            
        $header = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
        $header .="<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        $header .="<head>\n";
        $header .="<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
        $header .="<link href=\"styles/".$stylesheet."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n";
       	$header .="<title>Control Panel</title>\n";
       	$header .="<script src=\"../js/functions.js\" type=\"text/javascript\" language=\"JavaScript\"></script>";
		$header .="<script src=\"../js/newgroup.js\" type=\"text/javascript\" language=\"JavaScript\"></script>";
		$header .="<script src=\"../js/jquery-1.3.2.js\" type=\"text/javascript\" language=\"JavaScript\"></script>";
		$header .="<script type=\"text/javascript\" src=\"../js/ui/ui.core.js\"></script>";
		$header .="<script type=\"text/javascript\" src=\"../js/ui/ui.datepicker.js\"></script>";
		$header .="</head>\n";       
		
	

		
        return $header;
        
        }
        
   // Opens the body tag for output.
	function body_open(){
  		echo "<body>\n";
  		}
  		
   // Closes the body tag for output.
	function body_close(){
  		echo "</body>\n";
  		}
  		
	 // Closes the html tag for output.
	function html_close(){
  		echo "</html>";
  		}
  		
  	function buildSelectInput($array, $optionValue, $displayName){
  	
  		$html = "<label for=\"sectorSelect\">Sector Select</label>\n";
  		$html .= "<select name=\"sectorSelect\" id=\"sectorSelect\">\n";
  
  		foreach ($array as $value){
  			$html .= "<option value=\"".$value[$optionValue]."\">".$value[$displayName]."</option>\n";
  		}
  		
  		$html .= "</select>\n";
  		
  		return $html;
  	}
  	
  	function displayHeaderImage(){
  		
  		if ( isset( $_SESSION['lob'] ) ){
			if( !(strstr($_SESSION['lob'], ";" ))){
				$lob = str_replace(" ", "_", $_SESSION['lob']);
				$headerImage = "header_".$lob.".gif";
			}else{
				$headerImage = "header.gif";
			}
		}else{
		$headerImage = "header.gif";
	}
	return $headerImage;
	}
  	
}

?>